clc;
close all;
clear;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This script compare the FSL performance of two-phase control and split-phase control
% of Dickson converters.
% Assumptions: 1) constant current load 2) conversion ratio, N is even
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

<<<<<<< .mine
N=4:2:40;   % N is the conversion ratio
=======
N=4:2:12;   % N is the conversion ratio
>>>>>>> .r91

% two phase power loss unit is Iout^2*Rds
P2= 2./N*2+1*2+1+(N-2).^2/N.^2;  

% split-phase power loss, in a phase
P42=(1./(N-2)).^2.*(N/2-1+4)*2+1*2+1+(N-2).^2/N.^2;  

% split-phase power loss, in b phase
P44=2./(N-2)*2+1*2+1*2;

% split phase overall power loss
<<<<<<< .mine
P44=P2*2.*(N/2+1)./(2.*N)+P4*2.*(N/2-1)./(2.*N);
=======
P4=P42.*(N/2+1)./N+P44.*(N/2-1)./N;
>>>>>>> .r91

plot(N, P4./P2,'x-');
grid on;
xlabel('Conversion ratio')
ylabel('Normalized power loss wrt two-phase')
<<<<<<< .mine
ylim([1 1.2])

set_figure_style=======
% ylim([1 1.2])
>>>>>>> .r91
